/**
  @authoer: lss
  @date: 2020/12/31
  @note:
**/
package tool

import (
	"bytes"
	"os/exec"
)

func ExecCommand(command string) ([]byte, error) {
	cmd := exec.Command("bash", "-c", command)
	var output bytes.Buffer
	cmd.Stdout = &output
	cmd.Stderr = &output
	err := cmd.Run()
	return output.Bytes(), err
}
